﻿{extend name="index/index"}
{block name="centent"}
<div class="clear"></div>
<!--图片切换-->
<div class="nybanner"><img src="/static/index/imgs/nybanner.jpg" /></div>
<!--筛选条件-->
<ul class="select">
  <li class="select-list">
    <dl id="select1">
      {volist name="ress" id="v"}
      <dt>{$v['name']}：</dt>
      {/volist}
      <dd class="select-all selected"><a href="#">全部</a></dd>
      {volist name="res" id="v"}
      <dd><a href="{:url('index/Index/sanji',['path' => $v['path'], 'id' => $v['id']])}">{$v['name']}</a></dd>
      {/volist}
    </dl>
  </li>
</ul>
<div class="clear"></div>
<!--中间内容-->
<div class="subbox">
  <ul class="prolist">
    {empty name="picture"}

      <li style="width:100%;height:100px;text-align: center;line-height: 100px;"><font color="#ccc" size="5" align="center">还没有图片.....</font></li>

      {else/}

      {volist name="picture" key="k" id="v"}
      <li>
        <div class="proimg" style="width: 250px;"><a href="{:url('index/Index/detail',['id'=>$v['id']])}"><img src="http://pn5tyoo5a.bkt.clouddn.com/{$v.src}" width="250" height="290" /></a></div>
        <div class="protitle"><a href="#">{$v['title']}</a></div>
        <div class="proinfo">
          <span class="price"><a href="{:url('index/Fansfollow/toview',['uid' => $v['user_id']])}">
            {empty name="$v.icon" id="v"}
            <img src="/static/index/imgs/vip.jpg" width="30" height="30"/>
            {else /}
            <img src="http://pn5tyoo5a.bkt.clouddn.com/{$v.icon}" width="30" height="30"/>
            {/empty}</a>
          </span>
          <span class="price" style="color:black">&nbsp;&nbsp;&nbsp;{$v.name}</span>
          <span class="goumai">
          {empty name="v.follow"}
          <a href="javascript:void(0);" onclick="concern(this,'{$v.user_id}')">
          关注
          </a>
          {else /}
          <a href="javascript:void(0);" onclick="concern(this,'{$v.user_id}')" style="background: #90c31f;color:white">
          取消关注</a>
          {/empty}
        </a></span>
          <span class="goumai">
          {empty name="v.like"}
          <a href="javascript:void(0);" onclick="like(this,'{$v.id}')">收藏</a>
          {else /}
          <a href="javascript:void(0);" onclick="like(this,'{$v.id}')" style="background: #90c31f;color:white">已收藏</a>
          {/empty}
          </span>
        </div>
      </li>
      {/volist}
      {/empty}
  </ul>
</div>

  <script>
    // 按分类跳转
    function lists(obj,path){

                console.log(path);
                $.ajax({
                    url:'/Hmy_sanji',
                    Type:'get',
                    data:{path:path},
                    success:function(data){

                      if (data.status) {

                          toastr.success(data.msg);
                          window.location.reload();

                      } else {

                          toastr.error(data.msg);

                      }

                    },
                    error:function(data){

                        toastr.error('系统故障,请联系管理员');

                    }
                });
    }



    // 加入关注
    function concern(obj,uid){


                $.ajax({
                    url:'/concern',
                    Type:'get',
                    data:{uid:uid},
                    dataType:'json',
                    success:function(data){

                      if (data.status) {

                          toastr.success(data.msg);
                          window.location.reload();

                      } else {

                          toastr.error(data.msg);

                      }

                    },
                    error:function(data){

                        toastr.error('系统故障,请联系管理员');

                    }
                });
    }

    // 加入收藏
    function like(obj,id){
                // console.log(id);
                $.ajax({
                    url:'/like',
                    Type:'get',
                    data:{id:id},
                    dataType:'json',
                    success:function(data){

                      if (data.status) {

                          toastr.success(data.msg);
                          window.location.reload();

                      } else {

                          toastr.error(data.msg);

                      }

                    },
                    error:function(data){

                        toastr.error('系统故障,请联系管理员');

                    }
                });
    }
  </script>

{/block}